<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta http-equiv="content-type" content="text/html;charset=utf-8">
		<meta name="viewport" content="width=device-width,minimum-scale=1,maximum-scale=1,user-scalable=no">
		<title>食品数据融合与挖掘平台</title>
		<link rel="stylesheet" type="text/css" href="/layui/css/layui.css">
		<link href="/css/common.css" type="text/css" rel="stylesheet">
		<link rel="stylesheet" type="text/css" href="/css/nav.css">
		<link rel="stylesheet" type="text/css" href="/css/iconfont.css">
		<link rel='stylesheet' href='/model/css/DataInspector.css' />
		<link rel="stylesheet" type="text/css" href="/model/css/test.css">
		<script src="/js/jquery-3.2.1.min.js"></script>
		<script src="/layui/layui.js"></script>
		<script src="/js/alert.js"></script>
		<script src="/js/echarts.min.js"></script>
		<script src="/release/go.js"></script>
		<script src="/model/js/DataInspector.js"></script>
		<script src="/model/js/model.js"></script>
	</head>

	<body>
		<!-- 头部导航 -->
		<div class="jzy_w_max jzy_h_50 br_12">
			<!--菜单1-->
			<div class="jzy_h_50 br_12 br_11_hove lt top-txt">
				<a class="cr_h_0 fs_14" href="">食品数据融合与挖掘平台</a>
			</div>
			<!--头像-->
			<div class="jzy_w_50 jzy_h_50 br_12 br_11_hove rt top-txt logo">
				<img class="jzy_boy_18" src="/images/touxiang.jpg" width="36" height="36">
				<!-- 头像下拉菜单 -->
				<div class="jzy_w_270 jzy_h_408 br_h_0 top_nav">
					<!--头像跟用户名-->
					<div class="jzy_w_max jzy_h_50 lt" style="margin-top: 15px"><img class="jzy_boy_18" src="/images/touxiang.jpg"
						 width="36" height="36"></div>
					<div class="jzy_w_max jzy_h_30 lt" style="line-height: 30px; border-bottom: 1px solid #e2e2e2">17812100232</div>
					<!--用户公共操作权限-->
					<div class="jzy_w_250 jzy_h_250 lt" style="padding: 10px">
						<div class="jzy_w_80 jzy_h_80 lt br_h_2_hove">
							<a>
								<p class="jzy_h_30"><img src="/images/icon/jbzl.png"></p>基本资料
							</a>
						</div>
						<div class="jzy_w_80 jzy_h_80 lt br_h_2_hove">
							<a>
								<p class="jzy_h_30"><img src="/images/icon/smrz.png"></p>基本资料
							</a>
						</div>
					</div>
					<!--退出登录-->
					<div class="jzy_w_max jzy_h_42 lt br_h_9" style="background: #f5f5f6; line-height: 45px"><a href="/index">退出平台</a></div>
				</div>
			</div>
			<!--菜单3-->
			<div class="jzy_w_90 jzy_h_50 br_12 br_11_hove rt top-txt">
				<a class="cr_h_0 fs_14">权限设置</a>
				<!-- 头像下拉菜单 -->
				<div class="jzy_w_90 br_h_0 top_nav nav2">
					<p class="p"><a href="">新建权限</a></p>
					<p class="p"><a href="">角色列表</a></p>
				</div>
			</div>
		</div>
		<!--左侧主导航-->
		<div class="jzy_w_180 lt main_height main_left nav" style="background: #333744">
			<div class="nav-top">
				<div id="mini" style="background: #4a5064; text-align: center"><img src="/images/icon/suofang.png" width="20"></div>
			</div>
			<ul>
				<li class="nav-item" id="home">
					<a href="/page/home"><i class="my-icon nav-icon"></i><span>首页</span></a>
				</li>
				<li class="nav-item nav-show">
					<a href="javascript:;"><i class="my-icon nav-icon"></i><span>分类</span><i class="my-icon nav-more"></i></a>
					<ul>
						<li><a href="/page/LR"><span>LR</span></a></li>
						<li class="nav-show"><a href="/page/model"><span>SVM</span></a></li>
						<li><a href="/page/modelList"><span>决策树</span></a></li>
						<li><a href="/page/job"><span>贝叶斯</span></a></li>
					</ul>
				</li>
				<li class="nav-item">
					<a href="javascript:;"><i class="my-icon nav-icon"></i><span>回归</span><i class="my-icon nav-more"></i></a>
					<ul>
						<li><a href="/page/MCAlgorithm"><span>最小二乘回归</span></a></li>
						<li><a href="/page/MLJoblist"><span>贝叶斯回归</span></a></li>
					</ul>
				</li>
				<li class="nav-item">
					<a href="javascript:;"><i class="my-icon nav-icon"></i><span>聚类</span><i class="my-icon nav-more"></i></a>
					<ul>
						<li><a href=""><span>KNN</span></a></li>
						<li><a href=""><span>K-means</span></a></li>
						<li><a href=""><span>层次聚类</span></a></li>
					</ul>
				</li>
				<li class="nav-item">
					<a href="javascript:;"><i class="my-icon nav-icon"></i><span>降维</span><i class="my-icon nav-more"></i></a>
					<ul>
						<li><a href="/page/PCA"><span>PCA</span></a></li>
						<li><a href=""><span>kernal-PCA</span></a></li>
						<li><a href=""><span>FactorAnalysis</span></a></li>
					</ul>
				</li>
				<li class="nav-item">
					<a href="javascript:;"><i class="my-icon nav-icon"></i><span>集成</span><i class="my-icon nav-more"></i></a>
					<ul>
						<li><a href=""><span>Bagging</span></a></li>
						<li><a href=""><span>随机森林</span></a></li>
						<li><a href=""><span>GBDT</span></a></li>
					</ul>
				</li>
			</ul>
		</div>
		<!--主内容框架-->
		<div class="main_height main_index lt" style="background: #f2f4f8;">
			<div class="layui-btn-group demoTable jzy_w_max br_h_0 tabTop">
				<span>模型名称：</span>
				<span th:text="${modelname}" th:if="${not #strings.isEmpty(modelname)}"></span>
				<span style="margin-left: 10px;">模型描述：</span>
				<input class="input-text" id="description" type="text" placeholder="输入模型描述" style="width:200px;font-size: small;">
				<button class="layui-btn layui-btn-sm layui-btn-normal clickTab" id="SaveButton" onclick="save()">提交模型</button>
			</div>
			<div id="sample" style="padding-top: 20px;">
				<div>
					<div style="width: 100%; display: flex; justify-content: center">
						<div id="myPaletteDiv" style="margin-left: 5px;width: 15%; margin-right: 2px; background-color: whitesmoke; box-shadow: 2px 0px 7px #c5c5c5;">
						</div>
						<div id="myDiagramDiv" style="margin-left: 5px;flex-grow: 1; height: 600px; box-shadow: 2px 0px 2px #c5c5c5;">
						</div>
						<span style="display: inline-block; vertical-align: top;">
							<div id="myInspectorDiv" class="inspector" style="width: 70%; margin-right: 2px;">
							</div>
						</span>
					</div>
				</div>
			</div>
		</div>
		<script type="text/javascript" src="/js/nav.js"></script>
		<script src="/js/jump.js"></script>
		<script th:inline="javascript">
		var layer=null;
		layui.use("layer",function(){
            layer = layui.layer;
        });
		window.onload = function() {
			init();
		};
		/*<![CDATA[*/
		var uuid = /*[[${uuid}]]*/  null;
		var modelListHref= /*[[@{/page/modelList?}]]*/ null;
		/*]]>*/
		// TopRotatingTool类的结尾
        // 以JSON格式显示用户可编辑的图表模型
		function save() {
			saveDiagramProperties();  // 在写入JSON之前先执行此操作
			//document.getElementById("mySavedModel").value = myDiagram.model.toJson();
			var pos = myDiagram.model.toJson();
			var posString=JSON.stringify(pos);
			var name = $('#input-text').val();
			//myDiagram.isModified = false;
			$.ajax({
				type: "POST",
				dataType: "json",
				url: "/modelUpdate.do",
				data: {
					'uuid':uuid,
					'modelString':posString,
				},
				success: function (response) {
					if(response.status==0){
                        layer.alert("提交模型成功");
						location.href = modelListHref;
					}
				},
				error : function() {
					layer.alert("提交失败");
				}
			});
		}
		</script>
	</body>
</html>
